package cn.mw.cmdb.entity;

public enum FieldAuthType {
    require("必填","require"),
    readonly("只读","readonly"),
    unique("唯一","unique");

    private String name;
    private String type;

    FieldAuthType(String name, String type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static FieldAuthType getFieldAuthTypeByName(String name){
        for (FieldAuthType fieldAuthType : values()) {
            if (name.equals(fieldAuthType.getName())) {
                return fieldAuthType;
            }
        }
        return null;
    }
}
